//
//  UIButton+category.swift
//  swift-GWYWeiBo
//
//  Created by x on 2017/4/20.
//  Copyright © 2017年 HLB. All rights reserved.
//

import UIKit

extension UIButton {

    //快速创建一个UIButton
    class func creatButton(btuImage: String, btuTilte: String) ->UIButton {
        let btu = UIButton()
        btu.translatesAutoresizingMaskIntoConstraints = false
        btu.setImage(UIImage.init(named: btuImage), for: UIControlState.normal)
        btu.setTitle(btuTilte, for: UIControlState.normal)
        btu.titleEdgeInsets = UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 0)
        btu.setBackgroundImage(UIImage.init(named: "timeline_card_bottom_background"), for: UIControlState.normal)
        btu.titleLabel?.font = UIFont.systemFont(ofSize: 12)
        btu.setTitleColor(UIColor.darkGray, for: UIControlState.normal)
        return btu
    }
}
